<template>
  <div>
    
      <w-count :end-val="endValue" :decimals="2" :duration="2" :use-grouping="false" @on-anmiation-end="handlerAnmiationEnd">
        <span slot="left"> 总金额：</span> 
        <span slot="right"> 元</span> 
      </w-count>
    
      <button @click="handlerUpdateEndValue">随机更新</button>
    
  </div>
</template>

<script>
import WCount from '_c/w-count'

export default {
  name: 'count-page',
  components: {
    WCount
  },
  data () {
    return {
      endValue: 0
    }
  },
  methods: {
    handlerUpdateEndValue () {
      this.endValue += Math.random() * 100
    },
    handlerAnmiationEnd (countNumber) {
      console.log('动画结束,最新值已更新：',countNumber)
    }
  }
}
</script>
